package com.alangyun.remind.repository.param;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("depart")
public class Department implements Serializable {

	@XStreamAlias("code")
	@XStreamAsAttribute
	private Integer id;
	@XStreamAlias("name")
	@XStreamAsAttribute
	private String title;
	@XStreamAlias("children")
	private List<Department> children;
	
	public static Department create(int id, String name) {
		Department ret= new Department();
		ret.id = id;
		ret.title = name;
		ret.children = new ArrayList<>();
		
		return ret;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public List<Department> getChildren() {
		return children;
	}

	public void setChildren(List<Department> children) {
		this.children = children;
	}

}
